/**
 * 在生产环境 代理是无法生效的，所以这里没有生产环境的配置
 * -------------------------------
 * The agent cannot take effect in the production environment
 * so there is no configuration of the production environment
 * For details, please see
 * https://pro.ant.design/docs/deploy
 */
import defaultSetting from './defaultSettings';
let rewrite = `^${defaultSetting.proxypath}`;

export default {
  dev: {
    [defaultSetting.proxypath]: {
      // 要代理的地址
      target: defaultSetting?.dev_env,
      changeOrigin: true,
      pathRewrite: {
        [rewrite]: '',
      },
    },
    '/staticfile/': {
      target: 'http://192.168.40.2/',
      changeOrigin: true,
      pathRewrite: {
        '^/staticfile': '',
      },
    },
  },
  test: {
    [defaultSetting.proxypath]: {
      // 要代理的地址
      target: defaultSetting?.test_env,
      changeOrigin: true,
      pathRewrite: {
        [rewrite]: '',
      },
    },
  },
  pre: {
    [defaultSetting.proxypath]: {
      // 要代理的地址
      target: defaultSetting?.pro_env,
      changeOrigin: true,
      pathRewrite: {
        [rewrite]: '',
      },
    },
  },
};
